use "mcsui_usa.dta"
generate female = crespsex==2
generate white = crace==1
generate black = crace==2
generate asian = crace==3
generate native = crace==4
generate hispanic = chispan==1
generate age = crespage if crespage<99
generate education = eeduyrs if eeduyrs < 95
generate father_education = edadeduc if edadeduc<95
generate mother_education = emomeduc if emomeduc<95
generate colour_bin = lobssktn if lobssktn==1|lobssktn==2|lobssktn==3
replace colour_bin = 1 if lobssktn == 3
replace colour_bin = 3 if lobssktn == 1
rename crace race
*Graph for Figure 2
binscatter education colour_bin if white==1|black==1, by(race)
*Results for Appendix Table D.3
reg education colour_bin female age black asian native hispanic mother_education father_education,r
*Results for Appendix Table D.4
reg education colour_bin female age mother_education father_education if black==1,r
reg education colour_bin female age mother_education father_education if white==1,r
reg education colour_bin female age mother_education father_education if asian==1,r
reg education colour_bin female age mother_education father_education if hispanic==1,r
reg education colour_bin female age mother_education father_education if native==1,r
